import Vue from 'vue'
import Router from 'vue-router'
import home from '../components/tabber/home.vue'
import member from '../components/tabber/member.vue'
import shopcar from '../components/tabber/shopcar.vue'
import search from '../components/tabber/search.vue'
import mewlist from '../components/NewList/newlist.vue'
import newlistinfo from '../components/NewList/newlistinfo.vue'
import photolist from '../components/photolist/photolist.vue'
import goodslist from '../components/goodslist/goodslist.vue'
import goodsinfo from '../components/goodslist/goodsinfo.vue'
import goodsdesc from '../components/goodslist/goodsdesc.vue'
import goodscomment from '../components/goodslist/goodscomment.vue'

Vue.use(Router)

export default new Router({
  routes: [
    { path: '/', redirect: '/home' },
    { path: '/home', component: home },
    { path: '/member', component: member },
    { path: '/shopcar', component: shopcar },
    { path: '/search', component: search },
    { path: '/home/newlist', component: mewlist },
    { path: '/home/newlistinfo/:id', component: newlistinfo },
    { path: '/home/photolist', component: photolist },
    { path: '/home/goodslist', component: goodslist },
    { path: '/home/goodsinfo/:id', component: goodsinfo, name: 'goodsinfo' },
    // 这里面的name 就是给定义的路由起名字
    { path: '/home/goodsdesc/:id', component: goodsdesc, name: 'goodsdesc' },
    { path: '/home/goodscomment/:id', component: goodscomment }
  ],
  linkActiveClass: 'mui-active' //把路由选中的class修改为 mui-active ,原始是router-link-active,
})
